package org.example.demo3.server.mapper;

import org.apache.ibatis.annotations.*;
import org.example.demo3.pojo.entity.Admin;
import org.example.demo3.pojo.vo.AdminVO;
import org.springframework.web.bind.annotation.Mapping;

@Mapper
public interface AdminMapper {

    @Select("select * from test1.admin where username=#{username}")
    Admin queryAdminByUsername(String username);

    @Insert("insert into admin (name, username, password,sex,status, create_time, update_time) VALUES (#{name},#{username},#{password},#{sex},#{status},#{createTime},#{updateTime})")
    void insertAdmin(Admin admin);

    @Select("select * from admin where name=#{name}")
    Admin queryAdminByname(String name);

    @Select("select username,name,sex,img from test1.admin where name=#{name}")
    AdminVO queryAdminVOByname(String name);

    @Update("update test1.admin set img=#{img} where name=#{name}")
    void updateImgByName(@Param("name") String name, @Param("img") String img);
}
